import java.awt.*;

/**
 * Created by hasee on 2017/8/23.
 */
public class Node {
    int cro; int ver; Dir dir;
    int blocksize= Yard.BLOCK_SIZE;

    public Node(int cro, int ver){
        this.cro=cro;
        this.ver=ver;
    }

    public Node(int cro, int ver, Dir dir){
        this.cro=cro;
        this.ver=ver;
        this.dir=dir;
    }

    public void drawSnakeHead(Graphics g){//画蛇头
        Color c = g.getColor();
        g.setColor(Color.blue);
        g.fillRect((ver-1)*blocksize,(cro-1)*blocksize,blocksize,blocksize);
    }

    public void drawSnake(Graphics g){//画蛇身
        Color c = g.getColor();
        g.setColor(Color.black);
        g.fillRect((ver-1)*blocksize,(cro-1)*blocksize,blocksize,blocksize);
    }

    public void drawFood(Graphics g,int Size){//画食物
        Color c = g.getColor();
        g.setColor(Color.red);
        g.fillOval((ver-1)*blocksize,(cro-1)*blocksize, Food.foodsize, Food.foodsize);
        try {
            Thread.sleep(50);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        g.setColor(Color.green);
        g.fillOval((ver-1)*blocksize,(cro-1)*blocksize, Food.foodsize, Food.foodsize);
        g.setColor(c);
    }
}
